package com.gwt.tirso.gymkhana.client;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import javax.jdo.annotations.Element;
import javax.jdo.annotations.Extension;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.NotPersistent;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

@SuppressWarnings("serial")
@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Gymkhana implements Serializable {
	
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private String id;
	@Persistent
	private int nQuestions;
	@Persistent
	private int nMaxTeams;
	@Persistent
	private String name;
	@Persistent
	private String description;
	@Persistent
	private String rules;
	@Persistent
	private String pass;
	@Persistent
	private int nPoints;
	@Persistent
	private List<String> listQ;
	/*@Persistent
	private Person author;*/
	@NotPersistent
	private List<String> listQReaded = new ArrayList<String>();
	
	
	
	public String getPass() {
		return pass;
	}
	public void setPass(String pass) {
		this.pass = pass;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public String getRules() {
		return rules;
	}
	public void setRules(String rules) {
		this.rules = rules;
	}
	public String getId() {
		return id;
	}
	public void setId(String key) {
		this.id = key;
	}
	public int getnQuestions() {
		return nQuestions;
	}
	public void setnQuestions(int nQuestions) {
		this.nQuestions = nQuestions;
	}
	public int getnMaxTeams() {
		return nMaxTeams;
	}
	public void setnMaxTeams(int nMaxTeams) {
		this.nMaxTeams = nMaxTeams;
	}
	
	/*public Person getAuthor() {
		return author;
	}
	public void setAuthor(Person author) {
		this.author = author;
	}*/
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public void setQuestionList(List<String> lsq) {
		listQ = lsq;		
	}
	public List<String> getQuestionList(){
		return listQ;
	}
	/*public void setListQReaded(List<String> listQReaded) {
		this.listQReaded = listQReaded;
	}
	public List<String> getListQReaded() {
		return listQReaded;
	}*/
	public int getnPoints() {
		return nPoints;
	}
	public void setnPoints(int nPoints) {
		this.nPoints = nPoints;
	}
	public void addQuestion(Question q) {
		if(listQ == null){
			listQ = new ArrayList<String>();
		}
		listQ.add(q.getId());
		
	}
	public void setListQReaded(List<String> lqR) {
		listQReaded = lqR;
	}
	public List<String> getListQReaded(){
		return listQReaded;
	}
}
